﻿Imports Equipment.DataAccess

Public Class RequirementTypeLookup

#Region "Properties"
    Private _type As RequirementType
    Public Property ID As RequirementType
        Get
            Return _type
        End Get
        Set(ByVal value As RequirementType)
            _type = value
        End Set
    End Property

    Private _desc As String
    Public Property Description As String
        Get
            Return _desc
        End Get
        Set(ByVal value As String)
            _desc = value
        End Set
    End Property
#End Region

#Region "Public Section"
    Public Shared Function RetrieveAll() As List(Of RequirementTypeLookup)
        Dim result As New List(Of RequirementTypeLookup)

        result.Add(New RequirementTypeLookup With {.ID = RequirementType.Maintenance, .Description = "Maintenance"})
        result.Add(New RequirementTypeLookup With {.ID = RequirementType.Monitoring, .Description = "Monitoring"})

        Return result
    End Function

    Public Shared Function GetDescriptionByType(ByVal type As RequirementType) As String
        Dim first = RetrieveAll().SingleOrDefault(Function(rt) rt.ID = type)
        Return first.Description
    End Function
#End Region

End Class
